/**
*  
* @Function TODO 
* @ProjectName credit-data-platform 
* @PackageName com.py.credit.entity.enums    
* @FileName DataQualityFieldEnum.java    
* @Date 2018年7月11日下午3:23:02
* @Author Min DongXv
* @Copyright (c) 2018, 金电联行 All Rights Reserved.   
*   
*/  
package com.py.credit.entity.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.py.credit.entity.common.OptionalColumn;

/**
*   
* @Function TODO
* @ClassName DataQualityFieldEnum   
* @Date 2018年7月11日 下午3:23:02   
* @Author Min DongXv
*       
*/
public enum DataQualityFieldEnum {

	DATERANGE("dateRange", "期数", "varchar", true, "input", false, new HashMap<String, String>(), true, true),
	DEPTNUM("deptNum", "信源单位", "varchar", true, "input", false, new HashMap<String, String>(), false, false),
	DATANUM("dataNum", "报送数据", "varchar", true, "input", false, new HashMap<String, String>(), false, false),
	SCOUNT("scount", "入库数", "varchar", true, "input", false, new HashMap<String, String>(), false, false), FCOUNT(
			"fcount", "异常数", "varchar", true, "input", false, new HashMap<String, String>(), false,
			false), RCOUNT("rcount", "重复数", "varchar", true, "input", false, new HashMap<String, String>(), false,
					false), WCOUNT("wcount", "待关联", "varchar", true, "input", false, new HashMap<String, String>(),
							false, false),
	/*
	 * RRATE("rrate", "重复数", "varchar", true, "input", false, new HashMap<String,
	 * String>(), false,
	 * false), WRATE("wrate", "待关联", "varchar", true, "input", false, new
	 * HashMap<String, String>(), false,
	 * false),
	 */
	SRATE("srate", "入库率", "varchar", true, "input", false, new HashMap<String, String>(), false, false);
	
	private String colNameEN;
	private String colNameCN;
	private String type;
	private boolean defaultShow;
	private String widget;
	private boolean fuzzy;
	private HashMap<String, String> widgetValue;
	private boolean searchIsShow;
	private boolean advanceConditionShow;

	/**
	 * @param colNameEN
	 * @param colNameCN
	 * @param type
	 * @param defaultShow
	 * @param widget
	 * @param fuzzy
	 * @param widgetValue
	 * @param searchIsShow
	 * @param advanceConditionShow
	 */
	private DataQualityFieldEnum(String colNameEN, String colNameCN, String type, boolean defaultShow, String widget,
			boolean fuzzy, HashMap<String, String> widgetValue, boolean searchIsShow, boolean advanceConditionShow) {
		this.colNameEN = colNameEN;
		this.colNameCN = colNameCN;
		this.type = type;
		this.defaultShow = defaultShow;
		this.widget = widget;
		this.fuzzy = fuzzy;
		this.widgetValue = widgetValue;
		this.searchIsShow = searchIsShow;
		this.advanceConditionShow = advanceConditionShow;
	}

	/**
	 * @return the colNameEN
	 */
	public String getColNameEN() {
		return colNameEN;
	}

	/**
	 * @param colNameEN
	 *            the colNameEN to set
	 */
	public void setColNameEN(String colNameEN) {
		this.colNameEN = colNameEN;
	}

	/**
	 * @return the colNameCN
	 */
	public String getColNameCN() {
		return colNameCN;
	}

	/**
	 * @param colNameCN
	 *            the colNameCN to set
	 */
	public void setColNameCN(String colNameCN) {
		this.colNameCN = colNameCN;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type
	 *            the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the defaultShow
	 */
	public boolean isDefaultShow() {
		return defaultShow;
	}

	/**
	 * @param defaultShow
	 *            the defaultShow to set
	 */
	public void setDefaultShow(boolean defaultShow) {
		this.defaultShow = defaultShow;
	}

	/**
	 * @return the widget
	 */
	public String getWidget() {
		return widget;
	}

	/**
	 * @param widget
	 *            the widget to set
	 */
	public void setWidget(String widget) {
		this.widget = widget;
	}

	/**
	 * @return the fuzzy
	 */
	public boolean isFuzzy() {
		return fuzzy;
	}

	/**
	 * @param fuzzy
	 *            the fuzzy to set
	 */
	public void setFuzzy(boolean fuzzy) {
		this.fuzzy = fuzzy;
	}

	/**
	 * @return the widgetValue
	 */
	public HashMap<String, String> getWidgetValue() {
		return widgetValue;
	}

	/**
	 * @param widgetValue
	 *            the widgetValue to set
	 */
	public void setWidgetValue(HashMap<String, String> widgetValue) {
		this.widgetValue = widgetValue;
	}

	/**
	 * @return the searchIsShow
	 */
	public boolean isSearchIsShow() {
		return searchIsShow;
	}

	/**
	 * @param searchIsShow
	 *            the searchIsShow to set
	 */
	public void setSearchIsShow(boolean searchIsShow) {
		this.searchIsShow = searchIsShow;
	}

	/**
	 * @return the advanceConditionShow
	 */
	public boolean isAdvanceConditionShow() {
		return advanceConditionShow;
	}

	/**
	 * @param advanceConditionShow
	 *            the advanceConditionShow to set
	 */
	public void setAdvanceConditionShow(boolean advanceConditionShow) {
		this.advanceConditionShow = advanceConditionShow;
	}

	public static List<OptionalColumn> getOptionalColumns() {
		List<OptionalColumn> OptionalColumns = new ArrayList<OptionalColumn>();
		DataQualityFieldEnum[] values = DataQualityFieldEnum.values();
		for (DataQualityFieldEnum value : values) {
			OptionalColumn optionalColumn = new OptionalColumn(value.getColNameEN(), value.getColNameCN(),
					value.getType(), value.isDefaultShow(), value.getWidget(), value.isFuzzy(), value.getWidgetValue(),
					value.isSearchIsShow());
			OptionalColumns.add(optionalColumn);
		}
		return OptionalColumns;
	}

	public static List<String> getDefaultShowColumnEN() {
		List<String> columns = new ArrayList<String>();
		DataQualityFieldEnum[] values = DataQualityFieldEnum.values();
		for (DataQualityFieldEnum value : values) {
			if (value.isDefaultShow()) {
				columns.add(value.getColNameEN());
			}
		}
		return columns;
	}

	public static List<OptionalColumn> getAdvancedConditionColumns() {
		List<OptionalColumn> OptionalColumns = new ArrayList<OptionalColumn>();
		DataQualityFieldEnum[] values = DataQualityFieldEnum.values();
		for (DataQualityFieldEnum value : values) {
			if (value.isAdvanceConditionShow()) {
				OptionalColumn optionalColumn = new OptionalColumn(value.getColNameEN(), value.getColNameCN(),
						value.getType(), value.isDefaultShow(), value.getWidget(), value.isFuzzy(),
						value.getWidgetValue(), value.isSearchIsShow());
				OptionalColumns.add(optionalColumn);
			}
		}
		return OptionalColumns;
	}
}
